#!/bin/sh
date
#################the project init job#################
export BasePath="/cygdrive/e/project/SinaTay_Project"
export SSDIR=\\\\10.11.5.25\\VssSrcXinTai
export VSS_USR="dailybuild,sinosoft"

cd ${BasePath}
#################delete local files and get files from vss##########
if !(ant -k daily_init)
then 
echo "************************************************"
echo "sorry the daily_init job failed "
echo "************************************************"
exit 
fi

################clean vss#################
ss delete $/A_dailybuild/common/function     -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/function     -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/menu         -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/menu         -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/modify_base  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/modify_base  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/modify_data  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/modify_data  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/struct_base  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/struct_base  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/struct_data  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/struct_data  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/common/xml          -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/common/xml          -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/modify_base  -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/modify_data  -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/struct_base  -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/struct_data  -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/xml          -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/function     -I- -Y${VSS_USR}
ss create $/A_dailybuild/common/menu         -I- -Y${VSS_USR}


##################analyse xml and deal with ui ###############
sh ${BasePath}/lis_sh/daily_ui.yz

##################analyse xml and deal with java ###############
sh ${BasePath}/lis_sh/daily_java.yz

##################copy two xml files from lis_sh/ to A_dailybuild/common/xml ###############
cd ${BasePath}
cp lis_sh/build_daily_ui.xml A_dailybuild/common/xml
cp lis_sh/build_daily_java.xml A_dailybuild/common/xml
cp lis_sh/build_daily_class.xml A_dailybuild/common/xml

##################copy files to B_bak Dir###############################
cd ${BasePath}
ant -k daily_cleanup

##################add file to VSS from D_Bak Dir##########
ant -k dailybuild_add_backup_files_to_vss

date